#ifndef BST_TREE_H
#define BST_TREE_H

#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>

typedef struct bst_tree_node_  {
    int data;
    struct bst_tree_node_ *left;
    struct bst_tree_node_ *right;
}bst_tree_node;

typedef bst_tree_node *bst_tree;


bool bst_tree_insert(bst_tree *r, int data);
bool bst_tree_find(bst_tree *r, int data);
bool bst_tree_delete(bst_tree *r, int data);
void bst_tree_free(bst_tree *r);

bst_tree bst_tree_lookup( bst_tree *r, int data);
bst_tree bst_tree_lookup_pa( bst_tree *r, bst_tree tag);


void bst_tree_set_child(bst_tree pa, bst_tree old_ch, bst_tree new_ch);

bst_tree bst_tree_get_replace(bst_tree r);

#endif

